package JLB_Chapter_06;


// code_06_13
public class Grafical {
    final static double PI = 3.1415926;
    public static void main(String[] args) {
        double radius = 3.0;
        double area = PI * radius *  radius;
        double volume = 4 / 3 * PI * radius * radius * radius;
        Circular circular = new Circular(radius,area);
        Spherical spherical = new Spherical(radius,volume);
    }
}
class Circular {
    double radius;
    double area;
    public Circular(double radius, double area) {
        this.radius = radius;
        this.area = area;
        System.out.println("圆的半径是：" + radius + ",圆的面积是：" + area);
    }
}
class Spherical {
    double radius;
    double volume;
    public Spherical(double radius, double volume) {
        this.radius = radius;
        this.volume = volume;
        System.out.println("球的半径是：" + radius + ",球的体积是：" + volume);
    }
}